import { View, Image, Text } from '@tarojs/components'

import './index.scss'

const recommendedData = [
  {
      text1: 'XX phone',
      text2: '最高优惠200元',
      url1: require('../../../../assets/homeImg/recommendImg/recommend1.png'),
      url2: require('../../../../assets/homeImg/recommendImg/recommend2.png'),
  },
  {
      text1: 'XX watch',
      text2: '500元起',
      url1: require('../../../../assets/homeImg/recommendImg/recommend3.png'),
      url2: require('../../../../assets/homeImg/recommendImg/recommend4.png')
  },
  {
      text1: 'phone & watch',
      text2: '8折起购',
      url1: require('../../../../assets/homeImg/recommendImg/recommend5.png'),
      url2: require('../../../../assets/homeImg/recommendImg/recommend6.png')
  },
  {
      text1: 'XX配件',
      text2: '500元起',
      url1: require('../../../../assets/homeImg/recommendImg/recommend7.png'),
      url2: require('../../../../assets/homeImg/recommendImg/recommend13.png')
  },
  {
      text1: 'XX笔记本',
      text2: '5000元起',
      url1: require('../../../../assets/homeImg/recommendImg/recommend9.png'),
      url2: require('../../../../assets/homeImg/recommendImg/recommend10.png'),
  },
  {
      text1: 'XX笔记本',
      text2: '4000元起',
      url1: require('../../../../assets/homeImg/recommendImg/recommend11.png'),
      url2: require('../../../../assets/homeImg/recommendImg/recommend12.png')
  }
]

function Index () {
  return (
    <View className="recommended-containers">
      {recommendedData.map(item => {
        return (
          <View className="recommended">
            <View className="recommended-texts">
              <Text className="recommended-text1">{ item.text1 }</Text>
              <Text className="recommended-text2">{ item.text2 }</Text>
            </View>
            <View className="recommended-images">
              <Image className="recommended-image" src={ item.url1 } />
              <Image className="recommended-image" src={ item.url2 } />
            </View>
          </View>
        )
      })}
    </View>
  )
}

export default Index
